-----------------------------
Crater Shadows Simulator v1.2
-----------------------------

----------
Background
----------

The purpose of this Windows PC program is to improve awareness of the shadow patterns that are expected from cylindrically symmetric lunar landforms as a function of their height/depth profiles.  Simple craters, in particular, have been variously described as having hemispherical, parabolic, funnel-shaped or truncated cone shapes based on the shadows observed cast into them by their circular rims.  But these interpretations seem based more on intuition or gut feeling than on any scientific comparison of the observed shadow shapes with what would be expected for the various profiles.

Given a profile expressed as depth versus radius, the Crater Shadows Simulator uses a simple brute-force shadowing algorithm to predict what areas would be in light and which would be in shadow with parallel illumination over a flat surface at a specified angle (with respect to the horizontal). The profile can be specified either numerically (as a text file), or using a preset mathematical function. The profile can also be optionally warped onto a spherical surface with the Moon's IAU mapping radius of 1737.4 km.

Unlike more sophisticated ray-tracing simulations which show shades of gray as a function of illumination and observation angle, the Crater Shadows Simulator portrays its results in a simple black and white format.  It also does not take into account the finite angular size of the Sun (about 0.5 degrees, as seen from the Moon). The actual observed pattern for a given profile will be a weighted mix of the predicted patterns over that range of sun angles.


--------
Controls
--------

*Interior Profile* :  series of radio buttons to select cross-sectional shape inside the crater rim.

a. *Cone shaped* : the wall has a constant (straight line slope) from rim to floor.

b. *Parabolic* : the wall height above a reference point at the center of the crater is proportional to the square of the radial distance from the center.  If a flat floor is requested, the bottom of the parabola is filled in.  The shape (steepness) of the parabola is adjusted to span the requested height difference from floor to rim at the requested radii.

c. *Spherical* : the walls are a segment of a circle.  Note that because the depth can have only a single value at each radius, not all shapes can be meaningfully constructed with this option.  For example, it is not possible to describe a profile having circular walls with a Depth/Diam ratio of more than 0.5, since when the depth equals half the diameter the walls are already vertical at the rim.  If a flat floor is requested, an even smaller Depth/Diam ratio is required. When such impossible combinations of parameters are entered, an unexpected profile may result.

d. *Cubic* : this is the same as PARABOLIC except that the wall height increases as the cube of the distance from the crater center.

e. *Look up* :  the profile of depth as a function of radial distance from the crater center is read from a disk file.  Any shape can be described.  The surface height is assumed to vary linearly (straight line slopes) between the points specified.

f. "Include Moon's surface curvature" : if checked, points away from the feature center are lowered in proportion to the square of the radial distance to approximate the effect of the Moon's curvature. When checked, an additional input box appears that requests the true diameter of the crater rim in kilometers.  The amount of bending over the image area is determined by this value in relation to the Moon's radius of 1737.4 km : small craters will have very few kilometers of bending, larger craters will have larger amounts.  Mathematically speaking, a curve whose depth increases with the square of the radius is a parabola rather than a sphere, but it is a very good approximation to a sphere over the dimensions of lunar craters.  When the profile is read from a numeric disk file, this input box will be automatically filled in with the rim radius specified there, and cannot be manually overwritten.  If a Vertical Exaggeration is requested, it is applied *before* adding the profile to the curvature. When a profile specified by a formula is selected, any value can be entered for the rim diameter, but the results will approximate a sphere only when the entered diameter is less than a few hundred kilometers.

As an example of including the Moon's curvature, Plato, with ~2 km tall walls, a rim radius of about 100 km and a floor radius of 90 km, can be crudely approximated as a 100 km truncated cone with a Depth/Diameter ratio of 0.02 and a Floor/Rim ratio of 0.9 km on a curved Moon.  The effects of the curve on the basic shadow pattern can be studied by switching between the two modes (box checked and unchecked).  For these parameters, the effect of the curve becomes particularly dramatic for sun angle below about 1.6 degrees, where the curved floor begins to produce its own shadow on the side away from the Sun before being engulfed by the shadow from the sunward rim.  On the real Moon this is somewhat difficult to observe; and for a crater of this size, the considerable variability in the height of the rim above the floor makes the simulation only a crude approximation to reality.  

--

When a mathematical formula is selected for the crater cross section, the following controls are visible:

*Crater shape ratios* :  user inputs that control computed profile when a computed shape is used.

a. *Depth/Diam* :  ratio of crater depth to rim diameter.  This would be 0.5 for a half a circle.  The ratio for lunar craters is typically closer to 0.2.  If a flat floor is requested, this is the depth to the floor. Positive relief landforms (ones that stick out of the surface rather being depressed like craters) can be expressed by choosing a negative Depth/Diam ratio.

b. *Floor/Rim diam* : if you want the crater to have a flat floor, this is the ratio of the diameter of the flat floor circle to the diameter of the rim crest circle.  Setting the parameter to zero gives a shape with no flat section to the floor.

-- 

When profile type "Look up" is checked, these controls are visible instead: 

a, Top line of program display : identifies and permits change of disk file.  The numbers in the file are normalized to the crater radius specified within the file. 

b. *Vertical Exag* : preserves the shape specified in the disk file, but multiplies the heights and depths by the specified factor.  A Vertical Exaggeration of 1 gives the shape specified in the file.  For shapes on a flat surface, larger and smaller values of Vertical Exaggeration are exactly equivalent to lower and higher sun angles.  Choosing a negative Vertical Exaggeration will change a negative relief landform (an inward depression) into a positive relief landform (an outward bump). A value of -1 will do this without introducing distortion.

a. *Depth/Diam* : this read-only display is the current ratio from the rim crest to the deepest point in the numeric profile, including the Vertical Exaggeration factor.

See the end of this document for a detailed description of the file format.

--

The following additional controls are always visible:


*Sun angle* : specifies the angle (in degrees) above horizontal of the sunlight, which is assumed to be a point source from the right.  The crater is modeled as if it were on a flat surface, so the sun angle is constant across it.  On the real Moon, the surface is curved and the sun angle is lower on the parts to the left than on the parts to the right.

*Plot* button : the image panels on the right are refreshed by clicking the PLOT button.

*Profile panel* :  the upper panel on the right shows a cross-section through the center of the crater. This is presented on a fixed scale normalized to the radius of the crater rim.  Horizontally the plot runs from -1.1 radii to +1.1 radii.  Vertically, the crater rim level is plotted slightly below the top margin. The plot runs from a height of +0.05 radii at the top margin to a depth of -1.05 radii at the bottom margin. If a positive relief landform is being displayed (either by choosing a formula with a negative Depth/Diam ration, or by inverting a negative relief lookup file by using a negative Vertical Exaggeration), the vertical scale is set, instead, to run from a height of +1.05 radii at the top margin to a depth of -0.05 radii at the bottom margin. This causes the "rim" level to plot near the bottom of the graph, with the landform rising above it. In either case, the total spans are 2.2 crater radii horizontally and 1.1 crater radii vertically.  The graph box has this same aspect ratio (200x100 pixels), so profiles are shown with their true slopes -- that is, the angles portrayed are accurate. If the profile is supplied by a disk file (numeric "Look up" mode) portions of the profile may be drawn in red.  This represents areas in the plot where no information is available in the disk file. This can occur for radii smaller than the smallest radius for which depth data is supplied in the file, and for radii larger than the largest value.  In both cases the height/depth is assumed to be constant at the last available value.

*Shadow image panel* : the lower panel on the right shows the predicted shadow pattern. The image scale is the same as for the Profile Panel, so this is effectively a two-dimensional plan view, looking down on the profile from above.  The red circle indicates the crater radius.  Areas depicted in black are in shadow. Areas depicted in white are in sunlight.  


----------------- 
Program Operation
----------------- 

1. Select an interior profile option.

2. If a mathematical shape has been selected, specify the *Depth/Diameter* ratio and the *Floor Diameter to Rim Diameter* ratio.  If a numerically specified look-up profile has been selected, specify the *Vertical Exaggeration* (or set to 1).

3. Specify the desired *Sun Angle*.

4. Click the *Plot* button.

5. To copy the images to the Windows clipboard, click ALT-PrintScreen (the two keys together). The result can be pasted into any photo processing software.

6. Results with variant parameters can be compared by running multiple copies of the Crater Shadows Simulator simultaneously and blinking between them (use ALT-TAB to cycle between screens).

7. Expanding the size of the images : the images can be increased in size by dragging the lower right corner of the program form.  After changing the size, the images need to be refreshed by clicking the PLOT button. The computational time for refreshing the images will increase significantly both because of the larger number of points that have to be evaluated for shadowing and because of the longer path lengths over which the shadow evaluations need to be performed.


------------------------
Profile Disk File Format
------------------------

The disk files that can be read by the Crater Shadows Simulator are text files in Comma-Separated-Value format.  They follow the North American convention of using '.' for decimal points and ',' for item separators.  Files compatible with the Crater Shadows Simulator can be automatically generated by versions 0.19.3 and later of the Lunar Terminator Visualization Tool (LTVT : http://ltvt.wikispaces.com).  They are initiated with the Circle Drawing Tool, and points are added to the file using the Record Shadow Measurement right-click image option.

The basic format of a Crater Shadows Simulator compatible file consists of a line specifying the crater rim radius, followed by a series of lines listing the depth as a function of radius.

--- Start of sample file ---
* Moltke -- southern part of shadow on vhr_5075_med_raw.JPG
* Crater profile -- distances referenced to point at
*  Lon : 24.1476  Lat : -0.5714

Crater radius = 2.990

* Distance, Elev. Difference
0.253, -1.324
0.544, -1.267
1.175, -1.038
1.979, -0.607
2.613, -0.182

--- End of sample file ---

In this example, the data consists of measured depths referenced to the circular crater rim (assumed to be at a constant height), and distances of the shadow measurement points from the crater center.

Blank lines and lines starting with an asterisk (*) character are ignored. The depth and radius numbers must be in the same units (e.g., meters or kilometers), but the sequence of the data lines is unimportant: the program will create a profile by automatically sorting them in order of increasing radius.  It will also automatically normalize both the radius and depth numbers using the specified rim radius.  If no rim radius is given in the file, a warning will be issued and the program will proceed on the assumption that the largest radius listed represents the crater rim. The line specifying the rim radius must contain an equals sign.  The number appearing after the equals sign is taken as the radius, and the text preceding it is ignored.

If a comma is placed after the second number in the data lines (the depth reading), then any number of additional items can be placed after it.  They will be ignored by the Crater Shadows Simulator.  For example, the files automatically created by LTVT include the longitude and latitude of the shadow start and end points and the ID of the photo used for the measurement.

Any shape profile can be specified; however one that spans more than 1.1 crater radii in vertical or horizontal extent cannot be fully illustrated in the Profile Plot.  Also the height/depth at the rim position is normally set to zero which causes that level to print near the top of the Profile Plot.

It is convenient to set the height value at the rim radius to zero and reference all other heights to it.  This is because a height of zero plots near the top of the graph. But any value can be used.  For example, if the height data is offset so that the height value at the rim radius is -0.5*(Rim Radius), then the rim height will come out near -0.5 after normalization and plot near the bottom of the graph.  As long as all height data are offset by a constant amount, the zero point will have no effect on the shape of the profile and hence on the predicted shadow pattern.


---------------------------
Contact/Further Information
---------------------------

The Crater Shadows Simulator was written by Jim Mosher using the Delphi 6 programming language.  More information about it can be found on the LTVT Wiki:

  http://ltvt.wikispaces.com

or by contacting Jim:

  jimmosher@yahoo.com


----------------------------------------------------
Revision date of the this document: 12 November 2008
----------------------------------------------------
